package com.woniuxy.cinmea.management.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.woniuxy.cinmea.management.Clients.UserClient;
import com.woniuxy.cinmea.management.entity.Store;
import com.woniuxy.cinmea.management.mapper.StoreMapper;
import com.woniuxy.cinmea.management.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StoreServiceimpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
   @Autowired
   private  StoreMapper storeMapper;
   @Autowired
   private UserClient userClient;

    @Override
    public void add(Store store) {
        store.setHallCategoryList("[\"激光厅\", \"IMAX厅\", \"CGS中国巨幕厅\", \"杜比全景声厅\", \"Dolby Cinema厅\", \"RealD厅\", \"RealD 6FLag厅\", \"LUXE巨幕厅\", \"4DX厅\", \"DTS:X 临镜音厅\", \"儿童厅\", \"4K厅\", \"60帧厅\", \"巨幕厅\", \"MX4D厅\"]");
        store.setWorkStartTime("早上8:00");
        store.setWorkEndTime("凌晨2:00");
        store.setCinema_Status(0);
        store.setIsdelete(0);
        storeMapper.insert(store);
        int cinemaId = storeMapper.getId(store.getCinema_Name());
        userClient.cinemaAdd(store.getUserId(), cinemaId);
    }
}
